package com.biyao.schedulingcommon.exeception;


import com.biyao.schedulingcommon.response.StatusCode;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

import java.util.Objects;

@ResponseStatus(HttpStatus.BAD_REQUEST)
public class BadParamException extends RuntimeException {
    /**
     * 无参构造函数.
     */
    public BadParamException() {
    }

    /**
     * 有参构造函数.
     *
     * @param message 参数
     */
    public BadParamException(String message) {
        super(message);
    }

    public BadParamException(StatusCode statusCode) {
        super(Objects.isNull(statusCode) ? StatusCode.BAD_PARAM.getMsg() : statusCode.getMsg());

    }
}
